﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WellSchemeManage.aspx.cs" Inherits="SkWeb.FASJ.WellSchemeManage" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>井方案管理</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <link href="../easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script src="../easyui/jquery-1.8.0.min.js" type="text/javascript"></script>
    <script src="../easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <link  id="MyCss" href="../COMMON/CSS/Default.css" rel="stylesheet" type="text/css" />
    <link href="../css/adminCss.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript" language="javascript" src="../COMMON/JS/changerows.js" ></script>
    <script src="../js/NewCalendar.js" type="text/javascript"></script>
     <script type="text/javascript">

         $(function () {
             $("#aSubmitSave").click(function () {

                 var str = document.getElementById("frame").src;
                 if (str.indexOf("Word") >= 0) {
                     window.frames["frame"].SaveFile();
                     alert("保存成功！");
                 }
                 else {
                     window.frames["frame"].save();
                     alert("保存成功！");
                 }

             });
             $("#aClose").click(function () {
                 $('#w').window('close');
                 document.getElementById("frame").src = "#";

             });

         });
         function closeTab() {

             $('#w').window('close');
         }


         function browseDoc(obj) {
             var row = obj.parentNode;//.parentNode;  //
             //var jingName = row.cells[0].childNodes[0].data; //
             //var tmpName = row.cells[6].childNodes[0].data;
             var fa_id = $(row).find('input')[0].value;
             document.getElementById("frame").src = "../FAXZ/WordBrowse.aspx?hide_div_tool=1&op=sh&id=" + fa_id; // escape(jingName) + "&tmpName=" + escape(tmpName);
             $('#w').window('open');

             var wellname = row.parentNode.cells[0].innerHTML;
             $.post(
        '../Handlers/User_Action.aspx',
        {
            wellname: wellname,
            action: '在线浏览'
        },
        function (data, statusText) {

            //  $.messager.alert("提示", data, "提示");
            // message = data;

            //$("#dialogSchemeType").dialog("open");
        }
        );

         }




         function editDoc(obj) {
             var row = obj.parentNode; //.parentNode;  //
             //var jingName = row.cells[0].childNodes[0].data; //
             //var tmpName = row.cells[6].childNodes[0].data;
             var fa_id = $(row).find('input')[0].value;
             document.getElementById("frame").src = "../FAXZ/WordBrowse.aspx?tjyy=1&op=sh&id=" + fa_id; // escape(jingName) + "&tmpName=" + escape(tmpName);
             $('#w').window('open');

             var wellname = row.parentNode.cells[0].innerHTML;
             $.post(
        '../Handlers/User_Action.aspx',
        {
            wellname: wellname,
            action: '在线浏览'
        },
        function (data, statusText) {

            //  $.messager.alert("提示", data, "提示");
            // message = data;

            //$("#dialogSchemeType").dialog("open");
        }
        );

         }




         function downloadDoc(obj) {

             var row = obj.parentNode;  //
             //var jingName = row.cells[0].childNodes[0].data; //
             //var tmpName = row.cells[6].childNodes[0].data;
             var fa_id = $(row).find('input')[0].value;
             document.getElementById("frame").src = "../FAXZ/WordBrowse.aspx?op=download&id=" + fa_id;  // "jingName=" + escape(jingName) + "&tmpName=" + escape(tmpName);
             var wellname = row.parentNode.cells[0].innerHTML;

             $.post(
        '../Handlers/User_Action.aspx',
        {
            wellname: wellname,
            action:'下载'
        },
        function (data, statusText) {

          //  $.messager.alert("提示", data, "提示");
           // message = data;

            //$("#dialogSchemeType").dialog("open");
        }
        );
         
         }

         function deleteDoc(obj) {
             var row = obj.parentNode;  //
             var wellname = row.parentNode.cells[0].innerHTML;
             $.post(
        '../Handlers/User_Action.aspx',
        {
            wellname: wellname,
            action: '删除'
        },
        function (data, statusText) {

            //  $.messager.alert("提示", data, "提示");
            // message = data;

            //$("#dialogSchemeType").dialog("open");
        }
        );
//             var row = obj.parentNode.parentNode;  //
//             var jingName = row.cells[0].childNodes[0].data; //
//             var tmpName = row.cells[6].childNodes[0].data;

//             document.getElementById("frame").src = "../FAXZ/WordBrowse.aspx?op=delete&jingName=" + escape(jingName) + "&tmpName=" + escape(tmpName);
//         
         }

         $(function () {
             var cur_user_name = $("#curUseName").val();
             if (cur_user_name == "石莹" || cur_user_name == "姜晓燕") {
                 $(".hide").css('visibility', 'visible');
             }

             $(".download").click(function () {
             
             
             });


         });

     </script>

</head>
<body>
    <form id="form1" runat="server">
     <asp:HiddenField ID="curUseName"  runat="server" Value='' />
    <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="31" height="22">
                    <img src="../images/module.gif" width="20" height="22" alt=""/></td>
                <td style="width: 310px; text-align: left;">
                    &nbsp;<asp:Label ID="lblPath" runat="server"></asp:Label></td>
                <td width="990" align="right">
                    [<font color="red">  <a href="javascript:location.href=document.referrer;" class="F_red"><font color="red">返回    </font></a></font>]</td>
            </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td bgcolor="#3CB6E5" height="5px">
                </td>
            </tr>
        </table>

        <table  class="condTable"  border="0" cellspacing="0" cellpadding="0" width="99%" style=" font-size:17px">
        	<tr style=" font-size:17px; height:25px">
                <td style=" font-size:17px">&nbsp井号  </td>
                <td>
                    <asp:TextBox runat="Server" Height="17px" ID="txtJH"></asp:TextBox>
                </td>
        		<td style=" font-size:17px;">设计人</td>
                <td>
                    <asp:TextBox runat="Server" ID="txtSJR" Height="17px" CssClass="input"></asp:TextBox>
                </td>
                <td style=" font-size:17px;">起始日期</td>
                <td>
                    <asp:TextBox ID="txtDateStart" runat="Server" Height="17px" onclick="__showCalendar(this.id);" ReadOnly="true"></asp:TextBox>
                </td>
                <td style=" font-size:17px;">截止日期</td>
                <td>
                    <asp:TextBox ID="txtDateEnd" runat="Server" Height="17px" onclick="__showCalendar(this.id);" ReadOnly="true"></asp:TextBox>
                </td>
                <td>
                    <asp:Button runat="Server" ID="btnQuery" Text="查询" CssClass="submit" 
                        onclick="btnQuery_Click" />
                </td>
                 <td>
                    <asp:Button runat="Server" ID="expExcel" Text="导出操作日志" CssClass="submit" onclick="expExcel_Click" 
                         />
                </td>
        	</tr>
        </table>

    
    <table border="0" cellspacing="0" cellpadding="0" width="99%">
    	<tr>
    		<td>
                <asp:GridView CssClass="gridview"  runat="server" ID="gv_wellSchemeDesignList"
                        AutoGenerateColumns="False" CellPadding="4" Width="100%"
                        ForeColor="#333333" GridLines="None" Font-Size="18px" RowStyle-Font-Size="16px" RowStyle-Height="24px">
                    <Columns>
                    <%--<asp:BoundField DataField="FA_ID"  ItemStyle-HorizontalAlign="Center"  Visible="false" />--%>

                        <asp:BoundField DataField="JH" HeaderText="井号" ItemStyle-HorizontalAlign="Center"  />
                        <asp:BoundField DataField="JB" HeaderText="井别"  ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="SKJD1"  HeaderText="井段底深(m)" ItemStyle-HorizontalAlign="Center"  />
                        <asp:BoundField DataField="SKJD2" HeaderText="井段顶深(m)"  ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="SJR" HeaderText="设计人"  ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="SJRQ" HeaderText="设计日期" 
                        DataFormatString="{0: yyyy-MM-dd}"  ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="TMP_MC" HeaderText="模版名称" />
                        <asp:TemplateField HeaderText="操作">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate > 
                                <asp:HiddenField  runat="server" Value='<%# Eval("FA_ID") %>' />
                                <input type="button" class="submit" value="浏览" onclick="browseDoc(this)" />
                                <input type="button" class="submit " value="下载" onclick="downloadDoc(this)" />
                                <%--<input type="button" class="submit" value="删除" onclick="deleteDoc(this)" />--%>
                              <%--  <asp:Button ID="btnScan" CssClass="submit" runat="Server" Text="浏览" OnClick="btnScan_Click"  />--%>
                             <%--   <asp:Button ID="btnEdit" CssClass="submit" runat="Server" Text="编辑" OnClick="btnEdit_Click" />--%>
                                <input type="button" class="submit hide" value="编辑" onclick="editDoc(this)"  style=" visibility:hidden" />
                                <asp:Button ID="btnDelete" CssClass="submit hide "   OnClientClick="deleteDoc(this)" runat="Server" Text='删除' OnClick="btnDelete_Click"   style=" visibility:hidden" />
                            </ItemTemplate>
                        </asp:TemplateField>
                       

                    </Columns>
                    <EmptyDataTemplate>
                        <table class="gridview" style="width:99%;">
                            <tr>
			<th scope="col">井号</th><th scope="col">井别</th><th scope="col">井段底深(m)</th><th scope="col">井段顶深(m)</th><th scope="col">设计人</th><th scope="col">设计日期</th><th scope="col">模版名称</th><th scope="col">操作</th>
		</tr>
                        </table>
                    </EmptyDataTemplate>
                </asp:GridView>

            </td>
    	</tr>

        <tr>
            <td>
                <ep:AspNetPager ID="aspNetPagerSearch" Height="10px" Width="98%" CssClass="yahoo2"
                    runat="server" PageSize="10" LayoutType="Table" ShowCustomInfoSection="Right"
                    CustomInfoClass="custom" CustomInfoStyle=" clear:both;" ShowPageIndexBox="Always"
                    SubmitButtonImageUrl="../Images/go.png" ShowPageIndex="true" PageIndexBoxType="TextBox"
                    CustomInfoHTML="第 %CurrentPageIndex% 页，共 %PageCount% 页，每页显示 %PageSize% 条，共 %RecordCount% 条"
                    OnPageChanging="aspNetPagerSearch_PageChanging"  AlwaysShow="False">
                </ep:AspNetPager>
            </td>
        </tr>
    </table>
    </form>


	<div id="w" class="easyui-dialog" title="浏览" data-options="iconCls:'icon-edit',closed:true,toolbar: '#dlg-toolbar'"  style= "width:920px;height:650px;padding:0px; z-index:10000000">

    <div  style="padding:0px;height:550px"" >  
				   
                <iframe src="#" id="frame"  width="100%" height="100%" scrolling="no" style=" padding:0px"></iframe>
			</div>
	
	</div>





</body>
</html>
